package IOBaseTest;

import java.io.FileWriter;
import java.io.IOException;

/**
 * Created by yexuan on 2018/3/11.
 */
public class FileWriterDemo {
    public static void main(String[] args) throws IOException{

        //该文件会被创建到指定目录下，若该目录下已存在该文件，则覆盖
        FileWriter fw = new FileWriter("demo.txt");
        //write方法讲字符串写入流中
        fw.write("gygyfytft");

        //刷新流对象中缓冲区的数据
        fw.flush();
//        System.out.println("success");
        fw.close();


    }
}
